home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 5 / Amiga Plus Sonderheft 1996 #5.iso / programme / imagedesk304 / import_ps / import_ps2.idesk < prev    next >
Text File  |  1996-05-02  |  2KB  |  78 lines

  1. /* ---------------- ARexx-Script zur Uebergabe eines Bildes an PageStream 3.0i ------------ */
  2. /* ------------------------------------- Version 1.0 -------------------------------------- */
  3. /* ------------------- von Volkmar Funke -- EMail: Volkmar_Funke@BN.maus.de ----------------*/
  4. /* --- Dieses ARexx-Script importiert ein ausgewaehltes Bild von ImageDesk in PageStream ---*/
  5. /* ----- ohne Beruecksichtigung, das PageStream kein JPEG unterstuetzt (Zusatzmodul) -------*/
  6.  
  7.  
  8.  
  9. OPTIONS RESULTS
  10. PARSE ARG iname itype ipos
  11.  
  12.  
  13. /* Sicherstellung das ARexx supportet ist */
  14.  
  15. if ~show('L','rexxsupport.library') then
  16.         CALL ADDLIB('rexxsupport.library',0,-30)
  17. if ~show('L','softlogik:libs/slarexxsupport.library') then
  18.         CALL ADDLIB('softlogik:libs/slarexxsupport.library', 0, -30)
  19.  
  20.  
  21. if ~show(P, 'PAGESTREAM') then do  /* Fehlermeldung falls PageStream nicht gestartet ist*/
  22.         ADDRESS 'IDESK_REXXPORT'
  23.         IDREQUEST "OK" '" PageStream nicht gestartet "'
  24.         EXIT
  25. end
  26.  
  27.  
  28. ADDRESS 'PAGESTREAM'
  29.  
  30. /* Uebergabe der Grafik, falls kein Dokument geoeffnet Fehlermeldung */
  31.  
  32. 'refresh wait'
  33. placegraphic FILE '"'||iname||'"'
  34. if rc~=0 then do
  35.  
  36.     ADDRESS 'IDESK_REXXPORT'
  37.     IDREQUEST "OK" '" Kein Dokument in PageStream offen "'
  38.     signal cancel
  39. end
  40.  
  41. /* Typfestlegung und Anfrage ob ausgelgert werden soll */
  42.  
  43. 'getobject type objtype'
  44. objnum=result
  45. trace ?i
  46.  
  47. /* Position und Groesse festlegen, wie in PageStream 2.2 */
  48.  
  49. getregion coord message '" Klicke Position und/oder ziehe Groesse "'
  50. if rc=10 then do
  51.         'deleteobject'
  52.         signal cancel
  53. end
  54. if (abs(p2d(coord.x1)-p2d(coord.x2)))<0.25 | (abs(p2d(coord.y1)-p2d(coord.y2)))<0.25 then DO
  55.         if objtype=12 then getpicture position pstem
  56.         if objtype=2 then getdrawing position pstem
  57.         if objtype=13 then geteps position pstem
  58.         coord.x2=p2d(pstem.right)+p2d(coord.x1)
  59.         coord.y2=p2d(pstem.bottom)+p2d(coord.y1)
  60. end
  61.  
  62.  
  63. if objtype=12 then editpicture position coord.x1 coord.y1 coord.x2 coord.y2
  64. if objtype=2 then editdrawing position coord.x1 coord.y1 coord.x2 coord.y2
  65. if objtype=13 then editeps position coord.x1 coord.y1 coord.x2 coord.y2
  66.  
  67. 'refresh continue'
  68.  
  69. EXIT
  70.  
  71.  
  72. CANCEL:
  73.  
  74. ADDRESS 'PAGESTREAM' /* Muss durchgefuehrt werden, sonst keine Darstellung wenn neues */
  75. 'refresh continue'   /* Dokument geoeffnet wird */
  76.   EXIT
  77.  
  78.